import { Component, OnInit, Injector } from '@angular/core';
import { BaseTreeComponent } from '../base-tree/base-tree.component';

@Component({
  selector: 'app-gateway-pavmenu-tree',
  templateUrl: './gateway-pavmenu-tree.component.html',
  styleUrls: ['./gateway-pavmenu-tree.component.css']
})
export class GatewayPavmenuTreeComponent extends BaseTreeComponent implements OnInit {

  constructor(
    injector: Injector
  ) {
    super(injector)
  }

  ngOnInit() {
    this.treeSrv.getTreeData({
      url: this.srv.baseUrl + 'user/menu/getParentInfos',
      idName: 'menuId',
      topId: '0',
      parentIdName: 'parentId',
      labelName: 'menuTitle'
    }).then(tree => {
      if(tree&& tree.length){
        this.data = tree
      }
    }).catch(err => {
      console.error("请检查您的网络！")
    })
  }

}
